/*
* Public Open Domain
*
* This file do not have License. You can use it everywhere as you wish.
* 
*/

#ifndef CARTOGRAPHER_COMMON_GLOG_BYE_H_
#define CARTOGRAPHER_COMMON_GLOG_BYE_H_

#include <iostream>

#define LOG(severity) std::cout

#define LOG_IF(severity, condition) \
  !(condition) ? (void) 0 : LOG(severity)

#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) x
  
#define CHECK(condition)  \
      LOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) 

#define CHECK_OP_LOG(name, op, val1, val2) CHECK((val1)op(val2))

#define CHECK_OP(name, op, val1, val2) \
  CHECK_OP_LOG(name, op, val1, val2)

#define CHECK_EQ(val1, val2) CHECK_OP(_EQ, ==, val1, val2)
#define CHECK_NE(val1, val2) CHECK_OP(_NE, !=, val1, val2)
#define CHECK_LE(val1, val2) CHECK_OP(_LE, <=, val1, val2)
#define CHECK_LT(val1, val2) CHECK_OP(_LT, < , val1, val2)
#define CHECK_GE(val1, val2) CHECK_OP(_GE, >=, val1, val2)
#define CHECK_GT(val1, val2) CHECK_OP(_GT, > , val1, val2)

#define CHECK_NOTNULL(val) LOG(val)


#endif // CARTOGRAPHER_COMMON_GLOG_BYE_H_